package action;

import dao.RegisterUserDao;
import dao.TblManagerDao;
import pojo.TblRegisterUser;

public class RegisterUserAction {
	private Integer id;
	private String email;
	private String passwd;
	private String nameCn;
	private String sex;
	private Integer age;
	private String weight;
	private String height;
	private String bloodType;
	private String belief;
	private String degree;
	private String industry;
	private String income;
	private String province;
	private String marriage;
	private String bak1;
	private String bak2;
	TblRegisterUser tblRegisterUser = new TblRegisterUser();
	public RegisterUserAction(String email, String passwd,
			String nameCn, String sex, Integer age, String weight,
			String height, String bloodType, String belief, String degree,
			String industry, String income, String province, String marriage,
			String bak1, String bak2) {
		super();
		this.id = id;
		this.email = email;
		this.passwd = passwd;
		this.nameCn = nameCn;
		this.sex = sex;
		this.age = age;
		this.weight = weight;
		this.height = height;
		this.bloodType = bloodType;
		this.belief = belief;
		this.degree = degree;
		this.industry = industry;
		this.income = income;
		this.province = province;
		this.marriage = marriage;
		this.bak1 = bak1;
		this.bak2 = bak2;
		
	}
	public int addUser(){
		try{
	    tblRegisterUser = new TblRegisterUser(email,passwd,nameCn,
					sex,age,weight,height,
					bloodType,belief,degree,industry,
					income,province,marriage,bak1,bak2);
	    RegisterUserDao registerUserDao = new RegisterUserDao();
	    registerUserDao.addTblManager(tblRegisterUser);
		return 1;
		}catch(Exception e){
			e.printStackTrace();
			return 0;
		}
	}
	

}
